import { ref } from 'vue'
import { getCart } from '@/service/cart'
import { createStore } from 'vuex'

const store = createStore({
    state () {
        return {
            count: ref(0)
        }
    },
    mutations: {
        updateCart (state) {
            getCart().then(res => {
                state.count = res.data.length
            })

        }
    },
    actions: {
    },
    modules: {
    },
})
export default store